package com.example.serviceopenactivity

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.content.Intent
import androidx.core.app.ComponentActivity
import androidx.core.app.ComponentActivity.ExtraData
import androidx.core.content.ContextCompat.getSystemService
import android.icu.lang.UCharacter.GraphemeClusterBreak.T



class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        //连续启动Service
        val intentOne = Intent(this, LocalService::class.java)
        startService(intentOne)
//        val intentTwo = Intent(this, LocalService::class.java)
//        startService(intentTwo)
//        val intentThree = Intent(this, LocalService::class.java)
//        startService(intentThree)
//
//        //停止Service
//        val intentFour = Intent(this, LocalService::class.java)
//        stopService(intentFour)
//
//        //再次启动Service
//        val intentFive = Intent(this, LocalService::class.java)
//        startService(intentFive)
    }
}
